Skip to content

Conversation

@cwasicki
Copy link
Collaborator

@cwasicki cwasicki commented Jan 9, 2025

Initial version of trading CLI tool, which for now can only query DA prices from the entsoe API. Will be extended to support the real endpoints of the trading API later.

Example:

$trading-cli --entsoe_key=$ENTOSOE_API_KEY --start "2025-01-06T00:00:00+01:00" --end "2025-01-06T06:00:00+01:00" --country_code "DE_LU"
timestamp,price
2025-01-06 00:00:00+01:00,27.52
2025-01-06 01:00:00+01:00,19.26
2025-01-06 02:00:00+01:00,11.35
2025-01-06 03:00:00+01:00,9.2
2025-01-06 04:00:00+01:00,10.0
2025-01-06 05:00:00+01:00,14.81
2025-01-06 06:00:00+01:00,23.82

@cwasicki cwasicki requested a review from a team as a code owner January 9, 2025 00:30
@github-actions github-actions bot added part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) labels Jan 9, 2025
Copy link
Contributor

@camille-bouvy-frequenz camille-bouvy-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just nox is still failing

pyproject.toml Outdated
dynamic = ["version"]

[project.scripts]
trading-cli = "frequenz.client.electricity_trading.__main__:main"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this file be located in src/frequenz/client/electricity_trading/cli/__main__.py instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do, was thinking that this prevents to create another main, but not sure if we should do this.

Copy link
Contributor

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions and comments to check for. LGTM otherwise, it is really simple to use the entsoe API and library but I wonder where is the catch :D

@cwasicki
Copy link
Collaborator Author

but I wonder where is the catch :D

Rate limits ;-) And I am still not convinced about robustness from my first impression looking at it.

The new CLI tool is intended to be used for interaction with the trading API.
However, this initial version only provides functionality to list day-ahead
prices from the entsoe API.

Signed-off-by: cwasicki <[email protected]>
Copy link
Contributor

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I can see a disadvantage when using CET. There will be a "missing" timestamp record when time changes from CET to CEST for that day, and on the other hand an extra timestamp when changing from CEST to CET. This might lead to issues if the user not properly take care of time changes in trading apps.

@cwasicki
Copy link
Collaborator Author

But the timestamps are tz-aware, so it's not a duplicate or a missing timestamp, but the offset is included. See:

$trading-cli --entsoe_key=$ENTOSOE_API_KEY --start "2024-10-27T00:00:00+01:00" --end "2024-10-28T00:00:00+01:00"
timestamp,price
2024-10-27 01:00:00+02:00,84.0
2024-10-27 02:00:00+02:00,82.23
2024-10-27 02:00:00+01:00,80.43
2024-10-27 03:00:00+01:00,79.41
2024-10-27 04:00:00+01:00,78.79

I deliberately chose this timezone because this is used for EPEX trading.

@cwasicki cwasicki added this pull request to the merge queue Jan 10, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit a5f0a41 Jan 10, 2025
14 checks passed
@cwasicki cwasicki deleted the da branch January 10, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants